package com.sms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sms.mapper.CategoriesMapper;
import com.sms.pojo.Categories;
import com.sms.service.CategoriesService;
import com.sms.util.SqlSessionFactoryUtil;
import lombok.Getter;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.stereotype.Service;

@Service
@Getter
public class CategoriesServiceImpl extends ServiceImpl<CategoriesMapper, Categories> implements CategoriesService {
    SqlSession sqlSession=null;
    @Override
    public CategoriesMapper getBaseMapper() {
        SqlSessionFactory factory = SqlSessionFactoryUtil.getFactory();
        sqlSession=factory.openSession(true);
        CategoriesMapper mapper = factory.getConfiguration().getMapper(CategoriesMapper.class, sqlSession);
        return mapper;
    }


}
